home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_coinsilver.cog < prev    next >
Text File  |  1999-11-15  |  1KB  |  87 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_CoinSilver.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message    activated
  14. message    touched
  15. message    taken
  16.  
  17. cog        talkCog                    local
  18.  
  19. thing    player                    local
  20.  
  21. int        treasureBin=36            local
  22. int        coinBin=30                local
  23. int        value=40                local
  24.  
  25. end
  26.  
  27. # ===================================================================
  28.  
  29. code
  30.  
  31. activated:
  32.  
  33.     player = GetSourceRef();
  34.  
  35.     StartCutscene(0);
  36.  
  37.     if (!BitTest(GetThingFlags(player), 0x02000000))
  38.     {
  39.         talkCog = GetCogByIndex(0);
  40.         SendMessage(talkCog, 27);
  41.     }
  42.  
  43.     if (Rand() < 0.5)
  44.     {
  45.         SetExtCamOffset('0.15 -0.05 0.04');
  46.     }
  47.     else
  48.     {
  49.         SetExtCamOffset('-0.15 -0.05 0.04');
  50.     }
  51.     SetExtCamLookOffset('0.0 0.02 -0.01');
  52.  
  53.     return;
  54.  
  55. # -------------------------------------------------------------------
  56.  
  57. touched:
  58.  
  59.     player = GetSourceRef();
  60.  
  61.     if (GetInv(player, treasureBin) < GetInvMax(player, treasureBin))
  62.     {
  63.         TakeItem(GetSenderRef(), player);
  64.     }
  65.     else
  66.     {
  67.         EndCutscene();
  68.     }
  69.  
  70.     return;
  71.  
  72. # -------------------------------------------------------------------
  73.  
  74. taken:
  75.  
  76.     player = GetSourceRef();
  77.  
  78.     ChangeInv(player, treasureBin, value);
  79.     SetInvAvailable(player, treasureBin, 1);
  80.     JonesInvItemChanged(coinBin);
  81.  
  82.     EndCutscene();
  83.  
  84.     return;
  85.  
  86. end
  87.